import React from 'react'
import { withRouter, Switch, Redirect } from 'react-router-dom'
import LoadableComponent from '../../utils/LoadableComponent'
import PrivateRoute from '../PrivateRoute'

const Home = LoadableComponent(()=>import('../../routes/Home/index'))
const Swiper = LoadableComponent(()=>import('../../routes/Swiper/index'))
const Blog = LoadableComponent(()=>import('../../routes/Blog/index'))



@withRouter
class ContentMain extends React.Component {
  render () {
    return (
      <div style={{padding: 16, position: 'relative'}}>
        <Switch>
          
          <PrivateRoute exact path='/swiper' component={Swiper}/>
          <PrivateRoute exact path='/playlist' component={Home}/>
          <PrivateRoute exact path='/blog' component={Blog}/>
          <Redirect exact from='/' to='/swiper'/>
        </Switch>
      </div>
    )
  }
}

export default ContentMain
